<?php

    // Template controls
    $_load_controls = array(
        "menus"    => NULL,
        "controls" => NULL,
        "langs"    => NULL,
        "privacy"  => NULL,
        "social"   => NULL,
    );


    $_load_controls["login"] = isset($_SESSION['Auth']) ? '<a class="list-group-item"  href="?page=signin&cmd=logout"><i class="icon-star"></i> logout</a>' :
        '<a class="btn btn-large" href="?page=signup"><i class="icon-cog"></i> Εγγραφή </a><a class="btn btn-large" href="?page=signin"><i class="icon-user"></i> Σύνδεση </a>';

    /**
     *
     *   Main Page Menus
     *
     */
    $_tmp = array(
     //   'Αρχική'      => 'main',
        'Αναζήτηση'  => 'search',
    //   'Διαχείριση Αγγελιών'  =>  'admin_advert',
        'Όροι Χρήσης' => 'terms',
        'FAQ'         => 'faq',
        'Βοήθεια'     => 'help',
        'Περί'        => 'about',
    );

    $link = Controller::$_page['run'];

    while (list($key, $value) = each($_tmp)) {

        $_active = strcmp($link, $value) == 0 ? ' class="active" ' : NULL;
        $_load_controls["menus"] .= '<li ' . $_active . '><a  href="?page=' . $value . '" title="' . $key . '">' . $key . ' </a></li>';
    }


    /*
    $_langs = array(
        'English'  => 'cy-GB.gif',
        'Ελληνικά' => 'el-GR.gif',
    );


    while (list($key, $value) = each($_langs))
        $_load_controls["langs"] .= '<a   href="?page=lang&set=' . $key . '"><span class="Language selected" title="' . $key . '" style="background-image: url(Media/images/' . $value . ')"> &nbsp;  </span></a>';
    */


    $_load_controls_template = array(
        'controls' => $_load_controls["controls"],
        'menus'    => $_load_controls["menus"],
        'langs'    => $_load_controls["langs"],
        'social'   => $_load_controls["social"],
        'privacy'  => $_load_controls["privacy"],
        'login'    => $_load_controls["login"],
    );


    return $_load_controls_template;

?>
<html>
<HEAD>
    <link rel="shortcut icon"  href="Media/images/LogoPage.jpg" />
    </head>
</html>
